#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(this, &Widget::MySignal, this, &Widget::HandlerMySignal);

    //QString str = "hello world";
    //emit MySignal(str);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::HandlerMySignal(const QString& str)
{
    this->setWindowTitle(str);
}

void Widget::on_pushButton_clicked()
{
    QString str = "hello world";
    emit MySignal(str, "");
}
